<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<form:form modelAttribute="flightQuery">


	<div class="section">
	<span class="errors"> <form:errors path="*" /> </span> 
	
	<br />

	<h2>Book Flight</h2>

	<fieldset>

	<div class="field">
	<div class="label">Departing City:</div>
	<div class="input"><form:select path="departingCity" itemLabel="name" itemValue="id" items="${cityList}" /></div>
	</div>

	<div class="field">
	<div class="label">Destination City:</div>
	<div class="input"><form:select path="destinationCity" itemLabel="name" itemValue="id" items="${cityList}" /></div>
	</div>


	<div class="field">
	<div class="label">Departure Date:</div>
	<div class="input"><form:input path="departureDate" /></div>
	<script type="text/javascript">
	Spring.addDecoration(new Spring.ElementDecoration( {
		elementId : "departureDate",
		widgetType : "dijit.form.DateTextBox",
		widgetAttrs : {
			required : true,
			datePattern : "MM-dd-yyyy"
		}
	}));
</script></div>


	<div class="field">
	<div class="label">Return Date:</div>
	<div class="input"><form:input path="returnDate" /></div>
	<script type="text/javascript">
	Spring.addDecoration(new Spring.ElementDecoration( {
		elementId : "returnDate",
		widgetType : "dijit.form.DateTextBox",
		widgetAttrs : {
			required : true,
			datePattern : "MM-dd-yyyy"
		}
	}));
</script></div>

	<div class="field">
	<div class="label">Number of Passengers:</div>
	<div class="input"><form:select path="numberPassengers">
		<form:option value="1">1</form:option>
		<form:option value="2">2</form:option>
		<form:option value="3">3</form:option>
		<form:option value="4">4</form:option>
		<form:option value="5">5</form:option>
		<form:option value="6">6</form:option>
		<form:option value="7">7</form:option>
		<form:option value="8">8</form:option>
		<form:option value="9">9</form:option>
		<form:option value="10">10</form:option>
	</form:select></div>
	</div>


	<div class="buttonGroup"><input type="submit" id="proceed" name="_eventId_proceed" value="Search Flights" />&#160; <script type="text/javascript">
	Spring.addDecoration(new Spring.ValidateAllDecoration( {
		elementId : 'proceed',
		event : 'onclick'
	}));
</script></div>

	</fieldset>


	</div>
</form:form>
